<?php
namespace App\Model\User;

use EasySwoole\ORM\AbstractModel;

/**
 * Class AdminModel
 * Create With Automatic Generator
 * @property $adminId
 * @property $adminName
 * @property $adminAccount
 * @property $adminPassword
 * @property $adminSession
 * @property $adminLastLoginTime
 * @property $adminLastLoginIp
 */
class UserModel extends AbstractModel
{
    protected $tableName = 'sq_users';

    protected $primaryKey = 'id';

    public function withCommunity()
    {
        return $this->hasOne(CommunityModel::class, null, 'community', 'id');
    }

    public function withBuilding()
    {
        return $this->hasOne(BuildingModel::class, null, 'building', 'id');
    }
}
